{extend name="common/base" } {block name="content"}
<form action="{:module_url('index')}" class="search-form">
    <div class="am-g">
        <div class="am-u-sm-12 am-u-md-6">
            <div class="am-btn-toolbar">
                <div class="am-btn-group am-btn-group-xs">
                    <a class="am-btn am-btn-default" href="{:module_url('add')}">
                        <span class="am-icon-plus"></span> 新增
                    </a>
                    <a class="am-btn am-btn-default nd-refresh">
                        <span class="am-icon-refresh"></span> 刷新
                    </a>
                </div>
            </div>
        </div>

        {$widget->search('keyword', ['name' =>'keyword', 'holder' => '关键词', 'value' => $keyword, 'md_num' => 3])}
    </div>
</form>
<br>
<div class="am-g">
    <div class="am-u-sm-12">
        <table class="am-table am-table-striped am-table-radius am-table-bordered nd-sorted-table">
            <thead>
                <tr>
                    <th>广告名称</th>
                    <th>广告位置</th>
                    <th>广告图片</th>
                    <th>链接地址</th>
                    <th>状态</th>
                    <th>时间</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                {volist name="_list" id="vo"}
                <tr class="nd-sorted-item" data-id="{$vo.id}">
                    <td class="am-text-middle">{$vo.adver_name}</td>
                    <td class="am-text-middle">
                        {$widget->row('select', ['value' => $vo['position'], 'list' => $adverPosition, 'url' => module_url('modify', ['id' => $vo['id'],
                        'field' => 'position'])])}
                    </td>
                    <td class="am-text-center am-text-middle">
                        <div style="width: 100px;height: 40px;margin: 0 auto;background-repeat: round;background-image: url('{$vo.src}');"></div>
                    </td>
                    <td class="am-text-middle">{$vo.link}</td>
                    <td class="am-text-middle">
                        {$widget->row('select', ['value' => $vo['status'], 'list' => $adverStatus, 'url' => module_url('modify', ['id' => $vo['id'],
                        'field' => 'status'])])}
                    </td>
                    <td class="am-text-middle">{$vo.update_time}</td>
                    <td class="am-text-middle">
                        <div class="am-btn-toolbar">
                            <div class="am-btn-group am-btn-group-xs">
                                {$widget->row('button', ['title' => '编辑', 'class' => 'am-text-secondary', 'icon' => 'am-icon-pencil-square-o', 'url' =>
                                module_url('edit', ['id' => $vo['id']])])}
                                {$widget->row('button', ['title' => '删除', 'class' => 'am-text-danger ajax-get ajax-confirm', 'icon' => 'am-icon-trash-o',
                                'url' => module_url('delete', ['id' => $vo['id']])])}
                            </div>
                        </div>
                    </td>
                </tr>
                {/volist}
            </tbody>
        </table>
        {if condition="!empty($_page)"}
			<div class="am-fl">共 {$_total} 条记录</div>
			<div class="am-fr">{$_page}</div>
		{/if}
    </div>
</div>
{/block}